<?php
/**
 * Created by PhpStorm.
 * User: joc
 * Date: 2018/4/25
 * Time: 16:31
 */

namespace LDL\Twspider;


use LDL\Twspider\C\Taskrun;

/**
 * 当少于几个workers时就退出
 * Class MuseNullTask
 * @package LDL\Twspider
 */
class MuseNullTask extends  Taskrun
{
    function __construct($minNum)
    {
        $this->minNum = $minNum;
    }
    public function run()
    {

        parent::run();
        $sp=$this->worker->topSpider;

        /**
         * @var $sp Spider
         */

       // while(true){
      //      sleep(1);
          //  $curn=$sp->currentWorkersNum();
            //if($this->minNum >=$curn){
          //  $sp->dump();
            // echo ("quit numsadddd?? ".$curn);
               // return;
            //}
       // }
    }
}